NVM.SocialShare = function () {
    var __core = NOVEM.Core;
    var __modules = NOVEM.Modules;

    return {
        init: function (selector) {
            if (__core.getSelector(selector, false, false).length < 1) {
                return true;
            }
            __core.loadJS({ file: 'plugins/socialshare.js', id: 'nvm-socialshare-js', jsFolder: true });

            __core.isFuncTrue(function () {
                return typeof socialShare !== 'undefined';
            }).then(function (cond) {
                if (!cond) {
                    return false;
                }

                __core.initFunction({ class: 'has-plugin-socialshare', event: 'pluginSocialShareReady' });

                if (__core.getSelector(selector, false).length < 1) {
                    return true;
                }
                socialShare(selector, {
                    sites: ['wechat', 'qq', 'weibo'],
                    wechatQrcodeTitle: "微信扫一扫：分享", // 微信二维码提示文字
                    wechatQrcodeHelper: '<p>微信里点“发现”，扫一下</p><p>二维码便可将本文分享至朋友圈。</p>',
                });

                // qrcode待升级(https://github.com/kazuhikoarase/qrcode-generator/tree/master/js)

            });

        }
    };
}();
